<%--
  Created by IntelliJ IDEA.
  User: wlc
  Date: 2018/9/16
  Time: 15:40
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="PageFrame.jsp"%>
<%@ include file="Markdown-view.jsp"%>

<title>${userFile.getTitle()}</title>

<!-- Page Content -->
<div id="file-view-content">
    <div id="content-box">
        <div id="viewHead">
            <div id="viewHead-content">
                <div id="viewHead-title">
                    <h1 id="title-content">${userFile.getTitle()}</h1>
                </div>
                <div id="viewHead-info">
                    <div id="info-content">
                        <span class="doc-date">${userFile.getDate()}</span>
                        <span class="doc-author">${userFile.getUserId()}</span>
                        <span class="doc-type">类型：${userFile.getType()}</span>
                    </div>
                    <div id="operate-content">
                        <a href="../fileManager/fileEdit?fileId=${userFile.getId()}" class="doc-edit">编辑</a>
                    </div>
                </div>
            </div>
        </div>
        <article>
            <div id="viewSection"></div>
        </article>
    </div>
</div>
<!-- /Page Content -->

<!-- js-->
<script src="../js/file-show.js" type="text/javascript"></script>
<script type="text/javascript">
    //markdown编辑器
    var content = "${userFile.getContent()}";
    showEditor = new tui.Editor({
        el: document.querySelector('#viewSection'),
        initialValue: content,
        exts: ['table', 'uml'],
        language: 'zh'
    });
</script>
<!-- /js-->